home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 23 / CU Amiga - Super CD-ROM 23 (June 1998).iso / CUCD / Programming / AMOSList / AMOSLIST / text0142.txt < prev    next >
Encoding:
Text File  |  1998-04-01  |  2.5 KB  |  82 lines

  1. Garfield Benjamin (gbenjam@sosbbs.com) wrote:
  2.  
  3. >>>   Well, problem is this won't work. 
  4.  
  5. >   > Yes it will. I tried it.
  6.  
  7. >      Very strange as I just tried it as well and AMOS gives an error
  8. >      (missing End If) just as I suspected!!  The only thing I can 
  9. >      assume is that you and Keith are using AMOS Pro which must
  10. >      have changed things a bit.  In AMOS v1.36 it will NOT work.
  11.  
  12. Yup, you're right. It's AMOS Pro that allows it. Just ran Classic too
  13. and tried it. Error right away. 
  14.  
  15.  
  16. >> The logic is the same too. Select..is just
  17. >> more advanced in that it offers some extra features.
  18.  
  19. >   The logic is NOT the same.  Look at the above code again.  This
  20. >   will print "WOW, you're over 21!!" as long as AGE is greater than
  21. >   9 and unequal to 21... 
  22.  
  23. Ooops! You're completely right. But if we take another piece of code
  24. then, like this.
  25.  
  26. If A=1
  27.     print "Hello"
  28. else if a>1 and a<10
  29.     print "A is now between 2 and 9"
  30. else
  31.     print "A is 10 or higher"
  32. endif
  33.  
  34. and the same code using select
  35.  
  36. select A
  37.  
  38. case 1
  39.     print "Hello"
  40.  
  41. case 2-9
  42.     print "A is now between 2 and 9"
  43. case default
  44.     print "A is 10 or higher"
  45. end case
  46.  
  47. Not much of a difference. This is assuming one is using Pro, where the above
  48. syntax of if else if holds true. Here the logic is exactly the same. If clauses
  49. or select clauses is more often than not completely interchangeable. Sometimes
  50. select is far more efficient though.
  51.  
  52. >   > That would trigger the error-system. One if and three end-ifs is
  53. >   > plain wrong.
  54.  
  55. >      Try it... it works fine. 
  56.  
  57. Just did. Pro claims it's endif without if. In classic it worked as it should.
  58. So we were both right.
  59.  
  60. Didn't Europress claim that Pro was a 100% compatible to classic, beside the
  61. extensions? Well, it isn't apparently.
  62.  
  63. >      other, but the whole point of this thread was that it might be
  64. >      nice to have support for SELECT...CASE in AMOS.  :-)
  65.  
  66. Nice it would be indeed, especially for those stuck with Classic it seems. But for
  67. me there are other things that should be higher up on the prioritylist. Hopefully
  68. whoever is upgrading it thinks the same (hopefully for me that is). Only reason
  69. that I don't know that is that I just recently resubbed here. 
  70.  
  71. Shall we put this debate to end now? It seems we're basically agreeing.
  72.  
  73. ---
  74. Look at the shoes you're filling, look at the blood we're spilling
  75. Look at the world we're killing, the way we've always done before
  76. Look at the doubt we've wallowed, look at the leaders we've followed
  77. Look at the lies we've swallowed and I don't wanna hear no more
  78. ---
  79. Form an orderly queue behind the gunsight!
  80.  
  81.  
  82.